package com.hyt.model.cloudefile.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * jobkey枚举
 *
 * @author huangwu
 */
@Getter
public enum JobKeyEnum {

    /***文件导出****/

    /***文件导入***/
    CJIMPORTJOB("cjimpport", "成绩导入", SystemEnum.YKCJ),
    /***文件导入***/
    CJIMPORTCKECKJOB("cjimpportcheck", "成绩校验", SystemEnum.YKCJ),

    PJEXPORTJOB("pjexport", "评价数据导出", SystemEnum.PJ),

    PJEXPORTJOB_PROJECTDATADOWNLOAD("pjexport:projectDataDownload", "评价数据导出中小版评卷数据包", SystemEnum.PJ),
    PJEXPORTJOB_OBJECTIVESCOREDATADOWNLOAD("pjexport:objectiveScoreDataDownload", "评价数据导出中小版客观题成绩", SystemEnum.PJ),
    PJEXPORTJOB_DKBPROJECTDATADOWNLOAD("pjexport:dkbProjectDataDownload", "评价数据导出大考版评卷数据", SystemEnum.PJ),
    PJEXPORTJOB_DKBOBJECTIVESCOREDATADOWNLOAD("pjexport:dkbObjectiveScoreDataDownload", "评价数据导出大考版客观题成绩", SystemEnum.PJ),

    TKEXPORTJOB("tjexport", "题库试卷导出导出", SystemEnum.TK),

    KWEXPORTJOB("kwexport", "考务试卷导出", SystemEnum.KW),

    KWPAPEREXPORTJOB("kwpaperexport", "考务答卷导出", SystemEnum.KW),

    KW_GOV_BATCH_GENERATE_ADMISSION_TICKET_JOB("govgenerateticket", "政企考务批量生成准考证", SystemEnum.KWGOV),
    KW_GOV_BATCH_DOWNLOAD_ADMISSION_TICKET_JOB("govdownloadticket", "政企考务批量下载准考证", SystemEnum.KWGOV),
    ;


    /**
     * 对应的每一个jobkey
     */
    private final String key;
    /**
     * 描述信息
     */
    private final String keyDesc;


    private final SystemEnum systemEnum;


    private JobKeyEnum(String key, String keyDesc, SystemEnum systemEnum) {
        this.key = key;
        this.keyDesc = keyDesc;
        this.systemEnum = systemEnum;
    }


    public static JobKeyEnum getJobKeyEnumByKey(String key) {
        if (StringUtils.isEmpty(key)) {
            return null;
        }
        for (JobKeyEnum jobKeyEnum : JobKeyEnum.values()) {
            if (jobKeyEnum.getKey().equals(key)) {
                return jobKeyEnum;
            }
        }
        return null;
    }
}
